package org.vaadin.example.nf4v.demo.ui;

import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
import org.vaadin.nf4v.core.NavigableWindow;
import org.vaadin.nf4v.core.navigation.Navigator;
import org.vaadin.nf4v.ext.config.menu.Menu;
import org.vaadin.nf4v.ext.runtime.menu.tree.MenuTreeBuilder;

/**
 * todo: javadock
 */
@Menu(name = "Core")
public class MainWindow extends Window implements NavigableWindow{

    private Navigator navigator;

    public MainWindow() {
        HorizontalLayout layout = new HorizontalLayout();
        layout.setSizeFull();
        
        Tree navigation = MenuTreeBuilder.buildFullMenuTree(true);
        MenuTreeBuilder.openTree(navigation);
        layout.addComponent(navigation);

        navigator = new Navigator();
        layout.addComponent(navigator);

        setContent(layout);

        // show config buton
        // show events sniffer window
    }

    public Navigator getNavigator() {
        return navigator; 
    }
}
